<template>
  <router-view v-if="isRouterAlive"></router-view>
</template>

<script>
export default {
  name: 'App',
  provide() {
    return {
      reload: this.reload,
      handlerTime: this.handlerTime,
    }
  },
  mounted() {},
  data() {
    return { isRouterAlive: true }
  },

  methods: {
    reload() {
      this.isRouterAlive = false
      this.$nextTick(function () {
        this.isRouterAlive = true
      })
    },
    handlerTime(type, time) {
      let t_index = time.indexOf('T')
      let last_index = time.indexOf('.')
      if (type == 'day') {
        return time.slice(0, t_index)
      } else {
        return time.slice(t_index + 1, last_index)
      }
    },
  },
}
</script>

<style>
* {
  margin: 0;
  padding: 0;
  font-size: 12px;
  font-family: '微软雅黑';
}
ol,
ul,
dl {
  list-style: none;
}
</style>
